package com.neusoft.rental.controller;

import com.neusoft.rental.po.Placeappointment;
import com.neusoft.rental.po.Venuetime;
import com.neusoft.rental.service.PlaceappointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/PlaceappointmentController")
public class PlaceappointmentController {

    @Autowired
    private PlaceappointmentService placeappointmentService;

    //返回当前已被预约时间
    @RequestMapping("/querytimeperiod")
    public List<Venuetime> querytimeperiod(Placeappointment placeappointment){
        return placeappointmentService.querytimeperiod(placeappointment);
    }

    //预约场地申请提交
    @RequestMapping("/orderplace")
    public int orderplace(Placeappointment placeappointment){
        return placeappointmentService.orderplace(placeappointment);
    }

    //管理员查询预约信息
    @RequestMapping("/queryappointment")
    public List<Placeappointment> queryappointment(Placeappointment placeappointment) {
        return placeappointmentService.queryappointment(placeappointment);
    }

    //管理员处理审批（拒绝或者通过）
    @RequestMapping("/judgePlaceappoinment")
    public int judgePlaceappoinment(Placeappointment placeappointment) {
        return placeappointmentService.judgePlaceappoinment(placeappointment);
    }

    //用户获取通过审核的所有物资与场地
    @RequestMapping("/queryallappointment")
    public List<Object> queryallappointment(String userid){
        return placeappointmentService.queryallappointment(userid);
    }
}
